package com.project.server;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * 服务器类
 */
public class LisServer {
    public LisServer() {
        try {
            //开启服务器，开放8088端口
            ServerSocket serverSocket = new ServerSocket(8088);
            while (true) {
                //监听端口,处于线程阻塞状态，如果有客户端连接到服务器，将连接信息封装成Socket对象
                Socket socket = serverSocket.accept();
                new SocketThread(socket);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new LisServer();
    }
}
